<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  //ES6之前写法
  const obj = {
    name: 'James Gosling',
    age: 18,
    run: function () {
      console.log('奔跑!')
    }
  }
  obj.run();
  console.log(obj);

  //ES6之后的增强写法
  const name = 'James Gosling';
  const age = 19;
  const obj1 = {
    name,age,run () {
      console.log('奔跑')
    }
  }
  obj1.run();
  console.log(obj1);


</script>
</body>
</html>